import { createSSRApp } from 'vue'
import './style.css'
import App from './App.vue'
import {createSSRRouter} from './router'
import ElementPlus,{ElMessage} from 'element-plus'
import 'element-plus/dist/index.css'
import {createSSRI18n} from './language/i18n'
import {createSSRStore,key} from './store'
import {sync} from 'vuex-router-sync'

export function createApp(){
    const app = createSSRApp(App)
    const store = createSSRStore()
    const router = createSSRRouter()
    const i18n = createSSRI18n()
    sync(store,router)
    app.config.globalProperties.$message = ElMessage
    app.use(store,key)
    app.use(router)
    app.use(ElementPlus)
    app.use(i18n)
    return {app,router,store}
}
